import request from "@/utils/request";

/**
 * 获取企业列表
 *
 * @export
 * @param {*} params 参数
 * @returns {*}
 */
export function getEnterpriseListAPI(params) {
  return request.get("/park/enterprise", { params });
}

/**
 * 获取所属行业
 *
 * @export
 * @returns {*}
 */
export function getIndustryListAPI() {
  return request.get("/park/industry");
}

/**
 * 添加企业
 *
 * @export
 * @param {*} data 参数
 * @returns
 */
export function addEnterpriseAPI(data) {
  return request.post("/park/enterprise", data);
}

/**
 * 回显详细信息
 *
 * @export
 * @param {*} id 企业id
 * @returns
 */
export function getEnterpriseDetailAPI(id) {
  return request.get(`/park/enterprise/${id}`);
}

/**
 * 更新信息提交
 *
 * @export
 * @param {*} data 参数
 * @returns
 */
export function updateExterpriseAPI(data) {
  return request.put("/park/enterprise", data);
}

/**
 * 删除企业
 *
 * @export
 * @param {*} id 企业id
 * @returns
 */
export function deleteEnterpriseAPI(id) {
  return request.delete(`/park/enterprise/${id}`);
}

/**
 * 获取可租赁楼宇
 *
 * @export
 * @returns
 */
export function getRentBuildingAPI() {
  return request.get("/park/rent/building");
}

/**
 * 添加租赁合同
 *
 * @export
 * @param {*} data
 * @returns
 */
export function addRentAPI(data) {
  return request.post("/park/enterprise/rent", data);
}

/**
 * 获取展开租赁合同
 *
 * @export
 * @param {*} id 企业id
 * @returns
 */
export function getExpandRentAPI(id) {
  return request.get(`/park/enterprise/rent/${id}`);
}

/**
 * 合同退租
 *
 * @export
 * @param {*} id 合同id
 * @returns
 */
export function rentingOutAPI(id) {
  return request.put(`/park/enterprise/rent/${id}`);
}

/**
 * 移出合同
 *
 * @export
 * @param {*} id 合同id
 * @returns
 */
export function rentingDelAPI(id) {
  return request.delete(`/park/enterprise/rent/${id}`);
}
